architecture behavior of add_beh is
begin
  adder: 
  process(a,b,cin)
    variable carry : std_logic;
    variable tempsum : std_logic_vector(top downto 0);
    begin
      carry := cin;
      for i in 0 to top loop
        tempsum(i) := a(i) xor b(i) xor carry;
        carry  := (a(i) and b(i)) or (a(i) and carry) or (b(i) and carry);
      end loop;
      sum  <= tempsum;
      cout <= carry;
  end process adder;
end architecture behavior;